package cuit.service;

import java.util.List;
import cuit.domain.Blog;
import cuit.repositories.BlogRepository;

public class BlogService {
	private BlogRepository blogRepository ;

	public BlogService(){
		blogRepository = new BlogRepository();
	}
	
	public void insert(Blog blog){
		blogRepository.addBlog(blog);
	}
	
    public void update(Blog blog){
    	blogRepository.updateBlog(blog);
    }
  
    public void delete(Long blogId){
    	blogRepository.deleteBlog(blogId);
    }
    
    public List<Blog> listAll(){
    	return blogRepository.getAllBlogs();
    }

    public Blog getBlogById(String blogId){
    	return blogRepository.getBlogById(blogId);
    }
    
}
